package com.thinkinjava.genericity;

import java.util.Collection;

/**
 * @Description 泛型方法
 * @Author
 * @Date 2020/1/21 15:49
 **/
public class Generators {
    public static <T> Collection<T> fill(Collection<T> coll,Generator<T> gen ,int n){
        for (int i = 0; i < n; i++) {
            coll.add(gen.next());
        }
        return coll;
    }

    public static void main(String[] args) {

    }
}
